package com.info.zhiduoduo.repository.mapper.weixin;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.info.zhiduoduo.repository.entity.weixin.WxpayRecord;

import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 微信支付交易记录 Mapper 接口
 * </p>
 *
 * @author bob
 * @since 2019-12-08
 */
public interface WxpayRecordMapper extends BaseMapper<WxpayRecord> {

	@Select(" select * from zdd_wxpay_record where order_no = #{orderNo} and openid = #{openid} order by payid desc limit 1 ")
	WxpayRecord findLastOneByOrderNoAndOpenid(String orderNo, String openid);

	@Select(" select * from zdd_wxpay_record where pay_no = #{payNo}")
	WxpayRecord findOneByPayNo(String payNo);
}
